<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/list.css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/bp.css">
	<title>Insert title here</title>
	<style type="text/css">
		a:hover{
			cursor: pointer;
		}
		.breadcrumb,.breadcrumb li{
			font-size:20px;
			line-height: 50px;
		}
		.breadcrumb{
			padding: 28px 15px;
		}
		.form-control{
			display: inline-block;
			width: 270px;
			margin-right: 10px;
		}
		.btn-primary{
			line-height: auto;
		}
		.table tr{
			height: 45px;
		}
		.table > tbody > tr > td{
		    vertical-align: middle;
		}
	</style>

</head>
<body style="margin: 25px 0;">
	<div style="line-height: 50px;background: #f5f5f5;position: relative;">
		<ol class="breadcrumb">
			<li>公寓管理</li>
			<li>房屋信息</li>
		</ol>
		<div class="searchMes">
			<form action="${pageContext.request.contextPath}/lessee/search" method="post" class="forms">
				<input  class="form-control" placeholder="地区查询" name="name"/>
				<input type="submit" value="搜索" class="btn btn-primary" />
			</form>
		</div>
		<!-- ${pageContext.request.contextPath}/house/add -->
		<a class="btn btn-primary add_button" onclick="parent.location.href='${pageContext.request.contextPath}/house/add'">添加</a>
	</div>
	<div style=""> <!-- background-color: #f5f5f5 -->
		<table class="table table-striped table-hover table-bordered">
			<thead>
				<tr style="background: #E5E5E5">
					<th>姓名</th>
					<th>电话</th>
					<th>性别</th>
					<th>籍贯</th>
					<th>身份证号</th>
					<th>添加时间</th>
					<th style="width: 200px;">操作</th>
				</tr>
			</thead>
			<tbody>
			
				<c:forEach items="${lesseeSearch}" var="c">
					<tr>
					
						<td>${c.l_name}</td>
						<td>${c.l_tel}</td>
						<td>${c.l_sex=='0'?'男':'女'}</td>
						<td>${c.l_native_place}</td>
						<td>${c.l_id_card}</td>
						<td>
							<f:formatDate value="${c.l_add_time}" pattern="yyyy年MM月dd日  HH:mm分"/>
						</td>
						<td>
							<a onclick="parent.location.href='${pageContext.request.contextPath}/lessee/findLesseeMesByid?id=${c.l_id}'" style="padding: 0 10px;">编辑</a>
							<a onclick="deleteLessee(${c.l_id},'${pageContext.request.contextPath}')">删除</a>
						</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>
	<script type="text/javascript">
		function deleteHouse(i,path){
			var rs = confirm("确认要删除该房间的数据？删除后将无法恢复！")
			if(rs)
				parent.location.href = path+"/house/deleteHouseById?id="+i
		}
	
	</script>
</body>
</html>